import { default as request,cloud } from '@/framework/utils/request'

// 查询客服信息接入列表
export function listAccessInfo(query) {
  return request({
    url: cloud.business + '/chatAccessInfo/page',
    method: 'get',
    params: query
  })
}

// 查询客服信息接入详细
export function getAccessInfo(id) {
  return request({
    url: cloud.business + '/chatAccessInfo/detail?id=' + id,
    method: 'get'
  })
}

// 新增客服信息接入
export function addAccessInfo(data) {
  return request({
    url: cloud.business + '/chatAccessInfo/add',
    method: 'post',
    data: data
  })
}

// 修改客服信息接入
export function updateAccessInfo(data) {
  return request({
    url: cloud.business + '/chatAccessInfo/edit',
    method: 'post',
    data: data
  })
}

// 删除客服信息接入
export function delAccessInfo(id) {
  return request({
    url: cloud.business + '/chatAccessInfo/delete',
    method: 'post',
    data: { ids: id }
  })
}

// 客服聊天信息查询
export function getAccessInfoApi(data) {
  return request({
    url: cloud.business + '/chatAccessInfo/history/page',
    method: 'get',
    params: data
  })
}

// 接入信息列表查询
export function getAccessInfoList(data) {
  return request({
    url: cloud.business + '/chatAccessInfo/history/list',
    method: 'get',
    data: data
  })
}

// 客服消息撤回
export function revokeAccessInfoApi(data) {
  return request({
    url: cloud.business + '/chatAccessInfo/history/revoke',
    method: 'post',
    data: data
  })
}

// 客服聊天信息接入
export function getAccessInfoAllocationApi(query) {
  return request({
    url: cloud.business + '/chatAccessInfo/allocation',
    method: 'get',
    params: query
  })
}

// 客服消息转接
export function getAccessInfoswitchApi(data) {
  return request({
    url: cloud.business + '/chatAccessInfo/switch',
    method: 'post',
    params: data
  })
}

// 通讯记录信息
export function getCommunicateMessageApi(data) {
  return request({
    url: cloud.business + '/chatAccessInfo/history/message',
    method: 'get',
    params: data
  })
}

// 游客通讯转人工操作
export function transferToArtificalList(data) {
  return request({
    url: cloud.business + '/chatAccessInfo/transferToArtifical',
    method: 'post',
    data: data
  })
}